import { createStore } from 'vuex'
// import createLogger from 'vuex/dist/logger'

import state from './state'
import getters from './getters'
import mutations from './mutations'
import actions from './actions'

import BaseMapElModules from 'base/MapEl/store'
import homeModules from 'components/home/store'
import homeMapModules from 'components/homeMap/store'
import realtimeModules from 'components/realtime/store'
// import statisticsModules from 'components/statistics/store'
import statisticsSzModules from 'components/statisticsSz/store'
import statisticsBzModules from 'components/statisticsBz/store'
import libraryModules from 'components/library/store'

const isDev = process.env.NODE_ENV === 'development'

const store = createStore({
  strict: isDev,
  state,
  getters,
  mutations,
  actions,
  // plugins: isDev ? [createLogger()] : [],
  modules: {
    BaseMapEl: BaseMapElModules,
    home: homeModules,
    homeMap: homeMapModules,
    realtime: realtimeModules,
    // statistics: statisticsModules,
    statisticsSz: statisticsSzModules,
    statisticsBz: statisticsBzModules,
    library: libraryModules,
  }
})

export default store
